package com.qfdqc.views.demo;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.qfdqc.views.seattable.People;


/**
 * Created by 他的猫 on 2016/12/3.
 * 适配器
 */

public class BanSui_Adapter extends Base_Z_Adapter {
    BanSui_Adapter.Holder holder;


    public BanSui_Adapter() {

    }


    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        // 查找控件
        if (null == convertView) {
            convertView = LayoutInflater.from(MyApplication.getInstance())
                    .inflate(R.layout.tab_item_1_bansui, null);
            holder = new BanSui_Adapter.Holder();
            holder.times = (TextView) convertView
                    .findViewById(R.id.times);
            holder.zuowei = (TextView) convertView
                    .findViewById(R.id.zuowei);

            holder.title = (RelativeLayout) convertView
                    .findViewById(R.id.title);
            // 缓存Holder
            convertView.setTag(holder);
        } else {
            holder = (BanSui_Adapter.Holder) convertView.getTag();
        }
        People item = (People) getItem(position);
        holder.times.setText(item.getName());
        holder.zuowei.setText(item.getZuowei());
        return convertView;
    }

    public class Holder {
        TextView times, zuowei;
        RelativeLayout title;

    }
}
